﻿/*************************************************************************
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CatchUpTv.Tv;
using CatchUpTv.Utilities;

namespace CatchUpTv.Downloader
{
    /// <summary>
    /// The interface for a catch-up TV downloader.
    /// </summary>
    public interface IDownloader
    {
        /// <summary>
        /// The list of channels this downloader can download from.
        /// </summary>
        Lazy<IEnumerable<Channel>> Channels { get; }

        /// <summary>
        /// The list of shows this downloader can download from.
        /// </summary>
        Lazy<IEnumerable<Show>> Shows { get; }

        /// <summary>
        /// The Id for this downloader.
        /// </summary>
        string Id { get; }

        /// <summary>
        /// The name for this downloader.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// The image URL for this downloader.
        /// </summary>
        string ImageUrl { get; }

        /// <summary>
        /// Downloads the given episode.
        /// </summary>
        /// <param name="episode">The episode to download.</param>
        /// <returns>The local path to the downloaded episode</returns>
        string DownloadEpisode(Episode episode);

        /// <summary>
        /// Downloads the given episode.
        /// </summary>
        /// <param name="episode">The episode to download.</param>
        /// <param name="progressListener">The progress listener that will recieve percentage and size updates.</param>
        /// <returns>The local path to the downloaded episode</returns>
        string DownloadEpisode(Episode episode, Action<double, double> progressListener);
    }
}
